﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ImbaTracker.Models.Issue>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Brief) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Brief) %>
                <%: Html.ValidationMessageFor(model => model.Brief) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Description) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Description) %>
                <%: Html.ValidationMessageFor(model => model.Description) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.StartDate) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.StartDate, String.Format("{0:g}", Model.StartDate)) %>
                <%: Html.ValidationMessageFor(model => model.StartDate) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.PreferredEndDate) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.PreferredEndDate, String.Format("{0:g}", Model.PreferredEndDate)) %>
                <%: Html.ValidationMessageFor(model => model.PreferredEndDate) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.CriticalEndDate) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.CriticalEndDate, String.Format("{0:g}", Model.CriticalEndDate)) %>
                <%: Html.ValidationMessageFor(model => model.CriticalEndDate) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.StatusId) %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(model => model.StatusId, (IEnumerable<SelectListItem>)ViewData["statuses"])%>
                <%: Html.ValidationMessageFor(model => model.StatusId) %>
            </div>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.Priority) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Priority) %>
                <%: Html.ValidationMessageFor(model => model.Priority) %>
            </div>

            <div class="editor-field">
                <%: Html.DropDownListFor(model => model.ImplementerId, (IEnumerable<SelectListItem>)ViewData["users"])%>
                <%: Html.ValidationMessageFor(model => model.ImplementerId)%>
            </div>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.AssignerId)%>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(model => model.AssignerId, (IEnumerable<SelectListItem>)ViewData["users"])%>
                <%: Html.ValidationMessageFor(model => model.AssignerId)%>
            </div>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.ParentId)%>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(model => model.ParentId, (IEnumerable<SelectListItem>)ViewData["issues"])%>
                <%: Html.ValidationMessageFor(model => model.ParentId)%>
            </div>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

